<!--
 * @Author: wjc
 * @Date: 2025-09-28 09:02:43
 * @LastEditors: wjc
 * @LastEditTime: 2025-10-28 11:02:14
 * @Description: 
-->
<template>
  <EditorEmbed :entity="entity" :request-url="requestUrl" :message="message" />
</template>

<script setup lang="ts">
  import { api } from '#/api'
  import { useUserStore } from '#/stores/modules/user-store'

  defineOptions({
    name: 'MeProfile',
  })

  const props = withDefaults(
    defineProps<{
      entity?: string
    }>(),
    {
      entity: '',
    }
  )

  const message = '修改成功'
  const userStore = useUserStore()
  const userInfo = computed(() => userStore.userInfo)

  const requestUrl = ref({
    edit: api[props.entity].update(userInfo.value.id),
    update: api[props.entity].update(userInfo.value.id),
  })
</script>
